<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>

<%
String path = request.getContextPath();
request.setCharacterEncoding("UTF-8");
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html xmlns="http://www.w3.org/1999/xhtml">   
<head>
<base href="<%=basePath%>">
<title>数据筛选</title>
<jsp:include page="/WEB-INF/jsp/common/common.jsp"></jsp:include>	
<link href="css/calendar.css"  rel="stylesheet" type="text/css" >
	<script src="<%=path%>/js/jquery.divbox.js" type="text/javascript"></script>
	<script language="javascript" type="text/javascript">
		history.forward();
		$(document).ready(function() {
			isReadyIframe();
			
			$("#buttonUpload").click(function(){
				var fileNameStr = $('#fileToUpload').val();
				fileNameStr = fileNameStr+"";
				var lastDotIndex = fileNameStr.lastIndexOf(".");
				if(lastDotIndex==-1){
					$.message("error","请选择扩展名为 .xls 的文件上传");
					return;
				}else{
					var extName = fileNameStr.substring(lastDotIndex+1, fileNameStr.length);
					if(extName.toLowerCase() != "xls"){
						$.message("error","请选择扩展名为 .xls 的文件上传");
						return;
					}
				}
				$.ajaxFileUpload({
			        url:"<%=path%>/dataFilterManage/dataFilteForExcelTwoSheetCompare?"+new Date().getTime(),
			        fileElementId :'fileToUpload',//file控件id
			        dataType: 'json',
					contentType:'multipart/form-data',
			        success : function (data){
			        	if($.validate(data)) return;
			        }
				});
			});
		});
		function isReadyIframe(){
			var iframe = $(window.parent.document).find("#iframe").length;
			if(iframe==0){
				window.location.href="<%=basePath%>index.jsp";
			}
		}
		function downloadDataFilterTemplate(){
			window.location.href='<%=basePath%>dataFilterManage/downloadDataFilterTemplet?'+new Date().getTime();
		}
	</script>
	
	</head>
	<body>
 	 <div class="current">
           <table class="current_table_1">
             <tbody>
              	<tr class="f2">
	                <td><img src="./images/current_1.jpg"></td>
	                <td class="current_table_1_td">
	                  <img src="images/current_1.png">&nbsp;您现在的位置：&nbsp;
	                  <span style=" color:#136bab; ">统计分析
	                  	<span style="padding:0 5px; font-weight:bold; line-height:28px;">&gt;</span>数据筛选
	                  </span>
                  	</td>
                 	<td><img src="./images/current_3.jpg"></td>
              	</tr>
           	 </tbody>
           </table>
     </div>
        <table border="1" class="table_02" style="height:150px">
 	  		<tr>
	  			<td valign="middle">
		  				<div align="center" style="margin:15px">
			  				<input type="button" class="input_button_2" value="模板下载" onClick="downloadDataFilterTemplate()"/>&nbsp;&nbsp;
							<input  id="fileToUpload" name="myfiles" type='file' size='20'/>&nbsp;&nbsp;<input type="button" class="input_button_2" value="数据筛选" id="buttonUpload"/>
				  		</div>
				  		<div style="margin-bottom :0px;margin-right:35px;text-align:right;color:blue;">温馨提示：进行数据筛选操作前请仔细阅读模板的操作指南，严格按照操作指南执行操作。</div>
	  			</td>
	  		</tr>
	  	</table>
	</body>
</html>
